﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Drawing;
namespace P2P_Social_networking
{

    [ServiceContract(Namespace = "http://elcnet.servehttp.com/SocialP2P", CallbackContract = typeof(PeerServer))]
    public interface PeerServer
    {

        [OperationContract(IsOneWay = true)]
       
        void sendMessage(String message, Int32 PID, String sender);
        [OperationContract(IsOneWay = true)]
        void getAllProfileIDs(Int32 peerID, String userName);
        [OperationContract(IsOneWay = true)]
        void disconnect(Int32 peerID, String userName);
    }
   public interface PeerClient : PeerServer, IClientChannel
    {
       
    }
    /// <summary>
    /// Represents a user's personal profile
    /// </summary>
   public class PersonalProfile
   {
       public Bitmap profileImage;
       public String name;
       public String email;
       public Int32 id;
       /// <summary>
       /// Creates a new instance of PersonalProfile
       /// </summary>
       /// <param name="username">Someone's name</param>
       /// <param name="email">Someone's email address</param>
       /// <param name="UID">Their user ID</param>
       public PersonalProfile(String username, String Email, Int32 UID)
       {
           profileImage = new Bitmap(5, 5);
           name = username;
           email = Email;
           id = UID;
       }
       /// <summary>
       /// Creates a new instance of PersonalProfile and assigns a profile image to it.
       /// </summary>
       /// <param name="username">Someone's name</param>
       /// <param name="email">Someone's email address</param>
       /// <param name="UID">Their user ID</param>
       /// <param name="profileimage">Someone's picture</param>
       public PersonalProfile(String username, String Email, Int32 UID, Bitmap profileimage)
       {
           name = username;
           email = Email;
           id = UID;
           profileImage = profileimage;
       }
   }
    
}
